.class public final Lkairo/android/ui/y;
.super Lkairo/android/ui/w;

# interfaces
.implements Landroid/media/MediaPlayer$OnCompletionListener;
.implements Ljava/lang/Runnable;


# instance fields
.field private g:I

.field private h:I


# direct methods
.method private constructor <init>()V
    .locals 3

    const/4 v2, 0x0

    const/4 v0, 0x0

    const/4 v1, 0x1

    invoke-direct {p0, v0, v1, v2}, Lkairo/android/ui/w;-><init>(Ljava/lang/Object;II)V

    iput v2, p0, Lkairo/android/ui/y;->h:I

    return-void
.end method

.method public static b(Ljava/lang/String;)Lkairo/android/ui/y;
    .locals 3

    invoke-static {p0}, Lkairo/android/ui/s;->b(Ljava/lang/String;)I

    move-result v0

    if-nez v0, :cond_0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "\u30ea\u30bd\u30fc\u30b9\u3010"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\u3011\u304b\u3089ID\u3078\u306e\u5909\u63db\u306b\u5931\u8d25\u3057\u307e\u3057\u305f\u3002"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lkairo/android/i/i;->b(Ljava/lang/String;)Ljava/lang/String;

    :cond_0
    new-instance v1, Lkairo/android/ui/y;

    invoke-direct {v1}, Lkairo/android/ui/y;-><init>()V

    iput v0, v1, Lkairo/android/ui/y;->g:I

    return-object v1
.end method


# virtual methods
.method public final a()V
    .locals 5

    const/4 v4, 0x3

    const/4 v3, 0x0

    :try_start_0
    invoke-static {}, Lkairo/android/ui/z;->a()Lkairo/android/ui/z;

    move-result-object v0

    invoke-virtual {v0, p0}, Lkairo/android/ui/z;->d(Lkairo/android/ui/w;)V

    iget v1, p0, Lkairo/android/ui/y;->e:I

    if-eqz v1, :cond_0

    invoke-virtual {v0, p0}, Lkairo/android/ui/z;->b(Lkairo/android/ui/w;)V

    :cond_0
    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    check-cast v0, Landroid/media/MediaPlayer;
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const/4 v1, 0x0

    :goto_0
    :try_start_1
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->stop()V
    :try_end_1
    .catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :cond_1
    const/4 v1, 0x0

    :try_start_2
    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->release()V
    :try_end_2
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_2} :catch_1
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :cond_2
    iput-object v3, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    iput v4, p0, Lkairo/android/ui/y;->h:I

    :goto_1
    return-void

    :catch_0
    move-exception v2

    add-int/lit8 v1, v1, 0x1

    const/16 v2, 0xa

    if-gt v1, v2, :cond_1

    :try_start_3
    invoke-static {}, Ljava/lang/Thread;->yield()V
    :try_end_3
    .catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_3} :catch_1
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_0

    :catch_1
    move-exception v0

    iput-object v3, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    iput v4, p0, Lkairo/android/ui/y;->h:I

    goto :goto_1

    :catchall_0
    move-exception v0

    iput-object v3, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    iput v4, p0, Lkairo/android/ui/y;->h:I

    throw v0
.end method

.method public final a(IZ)V
    .locals 4

    const/4 v3, 0x1

    const/4 v2, 0x2

    invoke-static {}, Lkairo/android/ui/z;->a()Lkairo/android/ui/z;

    move-result-object v1

    :try_start_0
    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    if-eqz v0, :cond_1

    iget v0, p0, Lkairo/android/ui/y;->h:I

    if-ne v0, v2, :cond_1

    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    check-cast v0, Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    check-cast v0, Landroid/media/MediaPlayer;

    invoke-virtual {p0, p1, p2}, Lkairo/android/ui/y;->b(IZ)V

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->seekTo(I)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {p0}, Lkairo/android/ui/y;->a()V

    iget v0, p0, Lkairo/android/ui/y;->d:I

    if-ne v0, v3, :cond_2

    if-nez p2, :cond_0

    :cond_2
    iget v0, p0, Lkairo/android/ui/y;->e:I

    if-eqz v0, :cond_4

    const/4 v0, 0x2

    iput v0, p0, Lkairo/android/ui/y;->f:I

    :goto_1
    iget v0, p0, Lkairo/android/ui/y;->f:I

    invoke-virtual {v1, v0}, Lkairo/android/ui/z;->a(I)I

    move-result v0

    const/4 v2, -0x1

    if-eq v0, v2, :cond_0

    invoke-virtual {v1, v0}, Lkairo/android/ui/z;->b(I)V

    invoke-static {}, Lkairo/android/ui/IApplication;->a()Lkairo/android/ui/IApplication;

    move-result-object v2

    iget v3, p0, Lkairo/android/ui/y;->g:I

    invoke-static {v2, v3}, Landroid/media/MediaPlayer;->create(Landroid/content/Context;I)Landroid/media/MediaPlayer;

    move-result-object v2

    iput-object v2, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    invoke-virtual {p0, p1, p2}, Lkairo/android/ui/y;->b(IZ)V

    iget v3, p0, Lkairo/android/ui/y;->e:I

    if-eqz v3, :cond_3

    invoke-virtual {v1, p0}, Lkairo/android/ui/z;->a(Lkairo/android/ui/w;)V

    :cond_3
    invoke-virtual {v2, p0}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    const/4 v3, 0x2

    iput v3, p0, Lkairo/android/ui/y;->h:I

    invoke-virtual {v1, v0, p0}, Lkairo/android/ui/z;->a(ILkairo/android/ui/w;)V

    invoke-virtual {v2}, Landroid/media/MediaPlayer;->start()V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {p0}, Lkairo/android/ui/y;->a()V

    goto :goto_0

    :cond_4
    :try_start_1
    iget v0, p0, Lkairo/android/ui/y;->d:I

    if-nez v0, :cond_5

    const/4 v0, 0x1

    iput v0, p0, Lkairo/android/ui/y;->f:I

    goto :goto_1

    :cond_5
    const/4 v0, 0x0

    iput v0, p0, Lkairo/android/ui/y;->f:I
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1
.end method

.method public final b()V
    .locals 0

    invoke-virtual {p0}, Lkairo/android/ui/y;->a()V

    invoke-super {p0}, Lkairo/android/ui/w;->b()V

    return-void
.end method

.method public final b(IZ)V
    .locals 4

    const/high16 v3, 0x437f0000    # 255.0f

    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    :try_start_0
    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    check-cast v0, Landroid/media/MediaPlayer;

    if-eqz p2, :cond_1

    const/4 v1, 0x0

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/media/MediaPlayer;->setVolume(FF)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {p0}, Lkairo/android/ui/y;->a()V

    goto :goto_0

    :cond_1
    int-to-float v1, p1

    div-float/2addr v1, v3

    int-to-float v2, p1

    div-float/2addr v2, v3

    :try_start_1
    invoke-virtual {v0, v1, v2}, Landroid/media/MediaPlayer;->setVolume(FF)V
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0
.end method

.method public final c()I
    .locals 1

    iget v0, p0, Lkairo/android/ui/y;->h:I

    return v0
.end method

.method public final onCompletion(Landroid/media/MediaPlayer;)V
    .locals 1

    iget v0, p0, Lkairo/android/ui/y;->e:I

    if-nez v0, :cond_0

    invoke-virtual {p0}, Lkairo/android/ui/y;->a()V

    :goto_0
    return-void

    :cond_0
    :try_start_0
    new-instance v0, Ljava/lang/Thread;

    invoke-direct {v0, p0}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {p0}, Lkairo/android/ui/y;->a()V

    goto :goto_0
.end method

.method public final run()V
    .locals 3

    const/4 v1, 0x0

    :try_start_0
    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    check-cast v0, Landroid/media/MediaPlayer;

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const/4 v2, 0x0

    invoke-virtual {v0, v2}, Landroid/media/MediaPlayer;->seekTo(I)V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_1

    :goto_1
    if-nez v1, :cond_2

    :try_start_1
    new-instance v2, Ljava/lang/IllegalStateException;

    invoke-direct {v2}, Ljava/lang/IllegalStateException;-><init>()V

    throw v2
    :try_end_1
    .catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1

    :catch_0
    move-exception v2

    add-int/lit8 v1, v1, 0x1

    const/16 v2, 0xa

    if-gt v1, v2, :cond_0

    :try_start_2
    invoke-static {}, Ljava/lang/Thread;->yield()V
    :try_end_2
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_1

    :catch_1
    move-exception v0

    iget-object v0, p0, Lkairo/android/ui/y;->c:Ljava/lang/Object;

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lkairo/android/ui/y;->a()V

    goto :goto_0

    :cond_2
    :try_start_3
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->start()V
    :try_end_3
    .catch Ljava/lang/IllegalStateException; {:try_start_3 .. :try_end_3} :catch_0
    .catch Ljava/lang/Throwable; {:try_start_3 .. :try_end_3} :catch_1

    goto :goto_0
.end method
